<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
	if($_RQ['op']=='edit'){
	$item=$this->plugin_setting('setting');
    $return['item']=$item;
	$footernav =array(
		array('title'=>'文章分类','icon'=>'icon-shouye','action'=>'/news_group/'),
		array('title'=>'视频分类','icon'=>'icon-shouye','action'=>'/video_group/'),
		array('title'=>'文章列表','icon'=>'icon-map','action'=>'/news/'),
		array('title'=>'视频列表','icon'=>'icon-wo1','action'=>'/video/'),
	);
	//$return['item']['footernav']=json_decode($return['item']['footernav'],true);
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'设置',
		'edit_tab'=>true,
		'edits'=>array(
				array(
					'title'=>'基本信息',
					'list'=>array(
						array('type'=>'string','title'=>'网站名称','name'=>'title'),
						array('type'=>'image','title'=>'网站LOGO','name'=>'logo'),
						array('type'=>'switch','title'=>'关闭顶部返回？','name'=>'iscms','help'=>'关闭左上角会出现浮动返回门户按钮！'),
					)
				),
				array(
					'title'=>'幻灯片',
					'list'=>array(
						array('type'=>'array','name'=>'hdps','add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'图片'),	
									array('type'=>'string','name'=>'url','title'=>'地址'),	
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'图片'),	
									array('type'=>'string','name'=>'url','title'=>'地址'),
								)
						),
					)
				),
			/*	array(
							'title'=>'板块导航',
							'list'=>array(
									array('type'=>'array','name'=>'bankuai','add_tip'=>'添加一个板块导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),	
										array('type'=>'string','name'=>'action','title'=>'导航链接'),	
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),	
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									)
								),
							)
				),
				*/
				array(
							'title'=>'底部导航',
							'list'=>array(
								array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),	
										array('type'=>'string','name'=>'action','title'=>'导航链接'),	
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),	
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									)
								),
							)
				),
				array(
					'title'=>'分享设置',
					'list'=>array(
						array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
						array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
						array('type'=>'text','title'=>'分享描述','name'=>'share_desc'),
					)
				),
			)
	);
	$return['htmls']=$htmls;
	exi($return);
	}
if($_RQ['op']=='post'){
		$postdata=get_postdata();
	/*	$data=array(
			'title'=>trim($postdata['title']),
			'logo'=>trim($postdata['logo']),
			'iscms'=>intval($postdata['iscms']),
			'hdps'=>ijson_encode($postdata['hdps']),
			'bankuai'=>ijson_encode($postdata['bankuai']),
			'footernav'=>$postdata['footernav'],
			'share_title'=>trim($postdata['share_title']),
			'share_image'=>trim($postdata['share_image']),
			'share_desc'=>trim($postdata['share_desc']),
		);
		*/
		$item=$this->plugin_setting('setting',$postdata);
		exi('设置成功');
}
?>